<?php require_once('../Connections/hitekforyou.php'); ?>
<?php
error_reporting(0);
// Load the common classes
require_once('../includes/common/KT_common.php');

// Load the tNG classes
require_once('../includes/tng/tNG.inc.php');

// Make a transaction dispatcher instance
$tNGs = new tNG_dispatcher("../");

// Make unified connection variable
$conn_hitekforyou = new KT_connection($hitekforyou, $database_hitekforyou);

// Start trigger
$formValidation = new tNG_FormValidation();
$formValidation->addField("kt_login_user", true, "text", "", "", "", "");
$formValidation->addField("kt_login_password", true, "text", "", "", "", "");
$tNGs->prepareValidation($formValidation);
// End trigger

// Make a login transaction instance
$loginTransaction = new tNG_login($conn_hitekforyou);
$tNGs->addTransaction($loginTransaction);
// Register triggers
$loginTransaction->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "kt_login1");
$loginTransaction->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation);
$loginTransaction->registerTrigger("END", "Trigger_Default_Redirect", 99, "{kt_login_redirect}");
// Add columns
$loginTransaction->addColumn("kt_login_user", "STRING_TYPE", "POST", "kt_login_user");
$loginTransaction->addColumn("kt_login_password", "STRING_TYPE", "POST", "kt_login_password");
// End of login transaction instance

// Make a login transaction instance
$loginTransaction = new tNG_login($conn_hitekforyou);
$tNGs->addTransaction($loginTransaction);
// Register triggers
$loginTransaction->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "kt_login1");
$loginTransaction->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation);
$loginTransaction->registerTrigger("END", "Trigger_Default_Redirect", 99, "{kt_login_redirect}");
// Add columns
$loginTransaction->addColumn("kt_login_user", "STRING_TYPE", "POST", "kt_login_user");
$loginTransaction->addColumn("kt_login_password", "STRING_TYPE", "POST", "kt_login_password");
// End of login transaction instance

// Execute all the registered transactions
$tNGs->executeTransactions();

// Get the transaction recordset
$rscustom = $tNGs->getRecordset("custom");
$row_rscustom = mysql_fetch_assoc($rscustom);
$totalRows_rscustom = mysql_num_rows($rscustom);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Đăng nhập</title>
<link href="../includes/skins/mxkollection3.css" rel="stylesheet" type="text/css" media="all" />
<script src="../includes/common/js/base.js" type="text/javascript"></script>
<script src="../includes/common/js/utility.js" type="text/javascript"></script>
<script src="../includes/skins/style.js" type="text/javascript"></script>
<?php echo $tNGs->displayValidationRules();?>



<link href="login-box.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style1 {
	color: #FF0000;
	font-size: 36px;
	font-weight: bold;
}

.tableLogin {
	width:500px;
	background-image:url(images/login-box-backg.png);
}
-->
</style>
</head>

<body background="images/body-bg.jpg">
<table width="400" border="0" align="center" cellpadding="1" cellspacing="1">
  <tr>
    <td ><table  width="400" border="0" align="center" cellpadding="0" cellspacing="0" id="IPad">
      <tbody>
        <tr>
          <td valign="top" bgcolor="#FFFFFF"><div>
            <table width="400" border="0" align="center" cellpadding="0" cellspacing="0" id="main2">
              <tr>
                <td><table width="100%" border="0" cellpadding="0" cellspacing="0" id="IPad2">
                  <tbody>
                    <tr>
                      <td width="9"><img src="../images/bc-t-l.gif" width="9" height="9" /></td>
                      <td bgcolor="#FFFFFF"><img src="../images/spacer.gif" width="1" height="1" /></td>
                      <td width="11"><img src="../images/bc-t-r.gif" width="11" height="9" /></td>
                    </tr>
                    <tr>
                      <td bgcolor="#FFFFFF"><img src="../images/spacer.gif" width="1" height="1" /></td>
                      <td align="left" valign="top" bgcolor="#FFFFFF"><table width="100%" border="0" cellpadding="0" cellspacing="0">
                        <tbody>
                          <tr>
                            <td></td>
                          </tr>
                          <tr>
                            <td>&nbsp;
                              <div align="center" class="style1">Đăng Nhập                              </div>
                              <form method="post" id="form1" class="KT_tngformerror" action="<?php echo KT_escapeAttribute(KT_getFullUri()); ?>">
                                <table width="570" align="center" cellpadding="2" cellspacing="0" class="KT_tngtable">
                                  <tr>
                                    <td class="KT_th"><label for="kt_login_user">Tài khoản:</label></td>
                                    <td><input name="kt_login_user" type="text" class="form-login" id="kt_login_user" value="<?php echo KT_escapeAttribute($row_rscustom['kt_login_user']); ?>" size="32" />
                                        <?php echo $tNGs->displayFieldHint("kt_login_user");?> <?php echo $tNGs->displayFieldError("custom", "kt_login_user"); ?> </td>
                                  </tr>
                                  <tr>
                                    <td class="KT_th"><label for="kt_login_password">Mật khẩu:</label></td>
                                    <td><input name="kt_login_password" type="password" class="form-login" id="kt_login_password" value="" size="32" />
                                        <?php echo $tNGs->displayFieldHint("kt_login_password");?> <?php echo $tNGs->displayFieldError("custom", "kt_login_password"); ?> </td>
                                  </tr>
                                  <tr class="KT_buttons">
                                    <td colspan="2"><div align="center">
                                      <p>&nbsp;                                        </p>
                                      <p>
                                                                           <input type="submit" name="kt_login1" id="kt_login1"  value="Đăng nhập" />
                                        </p>
                                    </div></td>
                                  </tr>
                                </table>
                              </form>
                              <p>
                                
                              </p>
                              <p>&nbsp;</p></td>
                          </tr>
                        </tbody>
                      </table></td>
                      <td bgcolor="#FFFFFF"><img src="../images/spacer.gif" width="1" height="1" /></td>
                    </tr>
                    <tr>
                      <td><img src="../images/bc-u-l.gif" width="9" height="11" /></td>
                      <td bgcolor="#FFFFFF"><img src="../images/spacer.gif" width="1" height="1" /></td>
                      <td><img src="../images/bc-u-r.gif" width="11" height="11" /></td>
                    </tr>
                  </tbody>
                </table></td>
              </tr>
            </table>
          </div></td>
        </tr>
      </tbody>
    </table></td>
  </tr>
</table>
</body>
</html>
